package com.company.createtype.simpleFactory;

import com.company.Product;

public class Factory {

    public static class Toy extends Product{

    }
    public static class Cup extends Product{

    }

    public static Product createProduct(int type){
        switch (type){
            case 0:return new Toy();
            case 1:return new Cup();
            default:return null;
        }
    }
}
